<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
    <th:block th:if="!${#lists.isEmpty(dataMap['list'])}" th:each="examQuestionRecord : ${dataMap['list']}">
        <div th:hidden="${examQuestionRecord['webIndex']} !=1" th:attr="data-id=${examQuestionRecord['id']},data-index=${examQuestionRecord['webIndex']},data-type=${examQuestionRecord['examQuestion']['templateContent']['type']},data-no=${dataMap['pageNum']}">
            <p class="fs16">
                <span th:text="${#strings.concat(examQuestionRecord['webIndex'], '、[', examQuestionRecord['templateName'])+']'}"></span>
                <span th:utext="${examQuestionRecord['examQuestion']['templateContent']['trunk']}+'('+${examQuestionRecord['questionScore']}+'分)'"></span>
            </p>
            <!-- 有子试题循环开始 -->
            <th:block th:if="${examQuestionRecord['questionScoreJson']['haveSubTrunk']}">
                <div class="col-sm-12 sub-trunk-box" th:attrappend="data-type=${subTrunk['type']}" th:each="subTrunk,subIndex : ${examQuestionRecord['examQuestion']['templateContent']['subTrunkList']}">
                    <p class="fs16">
                        <span th:text="${#strings.concat('(', subIndex.count, ')')}"></span>
                        <span th:utext="${subTrunk['trunk']} +'('+${subTrunk['score']}+'分)'"></span>
                    </p>
                    <!-- 选项类试题 -->
                    <th:block th:if="${subTrunk['single']} or ${subTrunk['multi']} or ${subTrunk['judge']}">
                        <section class="mt20 ml20">
                            <p th:each="option : ${subTrunk['optionContextList']}">
                                <span class="fs16" th:utext="${#strings.concat(option['key'], '、', option['value'])}"></span>
                            </p>
                        </section>
                        <hr>
                        <section class="mt20 ml20 mb10">
                            <span class="fs16">请选择：</span>
                            <label class="checkbox-inline i-checks" th:each="option : ${subTrunk['optionList']}">
                                <th:block th:if="${#maps.isEmpty(subTrunk['userAnswerJson'])} or ${#lists.isEmpty(subTrunk['userAnswerJson']['answerOptList'])}">
                                    <input th:disabled="${status}==2" th:name="'optioin-'+${examQuestionRecord['id']}+'-'+${subIndex.count}" th:value="${option}" th:type="${subTrunk['multi']} ? 'checkbox' : 'radio'" >
                                </th:block>
                                <th:block th:if="!${#maps.isEmpty(subTrunk['userAnswerJson'])} and !${#lists.isEmpty(subTrunk['userAnswerJson']['answerOptList'])}">
                                    <input th:checked="${#lists.contains(subTrunk['userAnswerJson']['answerOptList'],option)}" th:disabled="${status}==2" th:name="'optioin-'+${examQuestionRecord['id']}+'-'+${subIndex.count}" th:value="${option}" th:type="${subTrunk['multi']} ? 'checkbox' : 'radio'" >
                                </th:block>
                                <span th:text="${option}"></span>
                            </label>
                            <th:block th:if="${status}==2">
                                <th:block th:if="${#maps.isEmpty(subTrunk['userAnswerJson'])}">
                                    <span class="fs16 c-danger">得分：0分</span>
                                </th:block>
                                <th:block th:if="!${#maps.isEmpty(subTrunk['userAnswerJson'])}">
                                    <span class="fs16 c-danger" th:text="'得分：'+${subTrunk['userAnswerJson']['userScore']}+'分'"></span>
                                </th:block>
                            </th:block>
                        </section>
                    </th:block>
                    <!-- 填空类 -->
                    <section class="mt20 ml20 mb10 col-sm-10" th:if="${subTrunk['blank']}">
                        <p th:each="option,aIndex : ${subTrunk['optionList']}">
                            <span class="fs16">
                                <span class="col-sm-8">
                                    <th:block th:if="${#maps.isEmpty(subTrunk['userAnswerJson'])} or ${#lists.isEmpty(subTrunk['userAnswerJson']['answerBlankList'])}">
                                        <input th:disabled="${status}==2" class="form-control mt5" name="inputBlank" type="text" placeholder="输入答案" />
                                    </th:block>
                                    <th:block th:if="!${#maps.isEmpty(subTrunk['userAnswerJson'])} and !${#lists.isEmpty(subTrunk['userAnswerJson']['answerBlankList'])}">
                                        <th:block th:each="userAnswer,uIndex : ${subTrunk['userAnswerJson']['answerBlankList']}">
                                            <input th:if="${aIndex.count}==${uIndex.count}" th:value="${userAnswer}" th:disabled="${status}==2" class="form-control mt5" name="inputBlank" type="text" placeholder="输入答案" />
                                        </th:block>
                                    </th:block>
                                </span>
                                <span class="col-sm-2 mt5">
                                    <th:block th:text="'('+${subTrunk['optScore']}+'分)'"></th:block>
                                </span>
                            </span>
                        </p>
                        <p th:if="${status}==2">
                            <span class="fs16">
                                <span class="col-sm-8 mt10">
                                    <th:block th:if="${#maps.isEmpty(subTrunk['userAnswerJson'])}">
                                        <span class="fs16 c-danger">得分：0分</span>
                                    </th:block>
                                    <th:block th:if="!${#maps.isEmpty(subTrunk['userAnswerJson'])}">
                                        <span class="fs16 c-danger" th:text="'得分：'+${subTrunk['userAnswerJson']['userScore']}+'分'"></span>
                                    </th:block>
                                </span>
                            </span>
                        </p>
                    </section>
                    <section class="mt20 ml20 mb10 col-sm-10" th:if="${subTrunk['special']}">
                        <textarea th:disabled="${status}==2" placeholder="输入答案" class="form-control" cols="20" th:text="${subTrunk['userAnswerJson']['userSpecialAnswer']}"></textarea>
                        <p th:if="${status}==2">
                            <span class="fs16">
                                <span class="col-sm-8 mt10">
                                    <th:block th:if="${#maps.isEmpty(subTrunk['userAnswerJson'])}">
                                        <span class="fs16 c-danger">得分：0分</span>
                                    </th:block>
                                    <th:block th:if="!${#maps.isEmpty(subTrunk['userAnswerJson'])}">
                                        <span class="fs16 c-danger" th:text="'得分：'+${subTrunk['userAnswerJson']['userScore']}+'分'"></span>
                                    </th:block>
                                </span>
                            </span>
                        </p>
                    </section>
                </div>
            </th:block>
            <!-- 无子试题循环 -->
            <th:block th:if="!${examQuestionRecord['questionScoreJson']['haveSubTrunk']}">
                <!-- 选项题 -->
                <th:block th:if="${examQuestionRecord['questionScoreJson']['single']} or ${examQuestionRecord['questionScoreJson']['multi']} or ${examQuestionRecord['questionScoreJson']['judge']}">
                    <section class="mt20 ml20">
                        <p th:each="option : ${examQuestionRecord['examQuestion']['templateContent']['optionContextList']}">
                            <span class="fs16" th:utext="${#strings.concat(option['key'], '、', option['value'])}"></span>
                        </p>
                    </section>
                    <hr/>
                    <section class="mt20 ml20 mb10">
                        <span class="fs16">请选择：</span>
                        <label class="checkbox-inline i-checks" th:each="option : ${examQuestionRecord['examQuestion']['templateContent']['optionList']}">
                            <th:block th:if="${#maps.isEmpty(examQuestionRecord['userAnswerJson'])} or ${#lists.isEmpty(examQuestionRecord['userAnswerJson']['answerOptList'])}">
                                <input th:disabled="${status}==2" th:name="'option-'+${examQuestionRecord['id']}" th:value="${option}" th:type="${examQuestionRecord['questionScoreJson']['multi']} ? 'checkbox' : 'radio'" th:text="${option}">
                            </th:block>
                            <th:block th:if="!${#maps.isEmpty(examQuestionRecord['userAnswerJson'])} and !${#lists.isEmpty(examQuestionRecord['userAnswerJson']['answerOptList'])}">
                                <input th:checked="${#lists.contains(examQuestionRecord['userAnswerJson']['answerOptList'],option)}" th:disabled="${status}==2" th:name="'option-'+${examQuestionRecord['id']}" th:value="${option}" th:type="${examQuestionRecord['questionScoreJson']['multi']} ? 'checkbox' : 'radio'" th:text="${option}">
                            </th:block>
                        </label>
                        <th:block th:if="${status}==2">
                            <span class="fs16 c-danger" th:text="'得分：'+${examQuestionRecord['userScore']}+'分'"></span>
                        </th:block>
                    </section>
                </th:block>

                <!-- 填空题 -->
                <section class="mt20 ml20 mb10 col-sm-10" th:if="${examQuestionRecord['examQuestion']['templateContent']['blank']}">
                    <p th:each="option,aIndex : ${examQuestionRecord['examQuestion']['templateContent']['optionList']}">
                        <span class="fs16">
                            <span class="col-sm-8">
                                <th:block th:if="${#maps.isEmpty(examQuestionRecord['userAnswerJson'])} or ${#lists.isEmpty(examQuestionRecord['userAnswerJson']['answerBlankList'])}">
                                    <input th:disabled="${status}==2" class="form-control mt5" name="inputBlank" type="text" placeholder="输入答案"/>
                                </th:block>
                                <th:block th:if="!${#maps.isEmpty(examQuestionRecord['userAnswerJson'])} and !${#lists.isEmpty(examQuestionRecord['userAnswerJson']['answerBlankList'])}">
                                    <th:block th:each="userAnswer,uIndex : ${examQuestionRecord['userAnswerJson']['answerBlankList']}">
                                        <input th:if="${aIndex.count}==${uIndex.count}" th:value="${userAnswer}" th:disabled="${status}==2" class="form-control mt5" name="inputBlank" type="text" placeholder="输入答案"/>
                                    </th:block>
                                </th:block>
                            </span>
                            <span class="col-sm-2 mt5">
                                <th:block th:text="'('+${examQuestionRecord['examQuestion']['templateContent']['optScore']}+')分'"></th:block>
                            </span>
                        </span>
                    </p>
                    <p th:if="${status}==2">
                        <span class="fs16">
                            <span class="col-sm-8 mt10">
                                <span class="fs16 c-danger" th:text="'得分：'+${examQuestionRecord['userScore']}+'分'"></span>
                            </span>
                        </span>
                    </p>
                </section>
                <section class="mt20 ml20 mb10 col-sm-10" th:if="${examQuestionRecord['examQuestion']['templateContent']['special']}">
                    <textarea th:disabled="${status}==2" th:text="${examQuestionRecord['userAnswerJson']['userSpecialAnswer']}" placeholder="输入答案" class="form-control" cols="20"></textarea>
                    <p th:if="${status}==2">
                        <span class="fs16">
                            <span class="col-sm-8 mt10">
                                <span class="fs16 c-danger" th:text="'得分：'+${examQuestionRecord['userScore']}+'分'"></span>
                            </span>
                        </span>
                    </p>
                </section>
            </th:block>
        </div>
    </th:block>
    <th:block th:if="${dataMap['pageNum']}==1 and ${dataMap['pages']} > 1">
        <th:block th:each="pageNo : ${#numbers.sequence(2,dataMap['pages'])}">
            <th:block th:each="index : ${#numbers.sequence(1,10)}">
                <th:block th:if="((${pageNo}-1) * 10 + ${index}) <= ${dataMap['total']}">
                    <div hidden class="temporary-box" th:attrprepend="data-no=${pageNo},data-index=((${pageNo}-1)*10 +${index})"></div>
                </th:block>
            </th:block>
        </th:block>
    </th:block>
</html>